/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.edu.uniandes.sar.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author LATITUDE
 */
@Entity
@Table(name = "liderfuncional")
@NamedQueries({
    @NamedQuery(name = "Liderfuncional.findAll", query = "SELECT l FROM Liderfuncional l"),
    @NamedQuery(name = "Liderfuncional.findByIdLiderFuncional", query = "SELECT l FROM Liderfuncional l WHERE l.idLiderFuncional = :idLiderFuncional"),
    @NamedQuery(name = "Liderfuncional.findByNombreLider", query = "SELECT l FROM Liderfuncional l WHERE l.nombreLider = :nombreLider")})
public class Liderfuncional implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idLiderFuncional")
    private Integer idLiderFuncional;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "nombreLider")
    private String nombreLider;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "liderfuncional")
    private List<Requerimiento> requerimientoList;

    public Liderfuncional() {
    }

    public Liderfuncional(Integer idLiderFuncional) {
        this.idLiderFuncional = idLiderFuncional;
    }

    public Liderfuncional(Integer idLiderFuncional, String nombreLider) {
        this.idLiderFuncional = idLiderFuncional;
        this.nombreLider = nombreLider;
    }

    public Integer getIdLiderFuncional() {
        return idLiderFuncional;
    }

    public void setIdLiderFuncional(Integer idLiderFuncional) {
        this.idLiderFuncional = idLiderFuncional;
    }

    public String getNombreLider() {
        return nombreLider;
    }

    public void setNombreLider(String nombreLider) {
        this.nombreLider = nombreLider;
    }

    public List<Requerimiento> getRequerimientoList() {
        return requerimientoList;
    }

    public void setRequerimientoList(List<Requerimiento> requerimientoList) {
        this.requerimientoList = requerimientoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idLiderFuncional != null ? idLiderFuncional.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Liderfuncional)) {
            return false;
        }
        Liderfuncional other = (Liderfuncional) object;
        if ((this.idLiderFuncional == null && other.idLiderFuncional != null) || (this.idLiderFuncional != null && !this.idLiderFuncional.equals(other.idLiderFuncional))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return this.nombreLider;
    }
    
}
